import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router';
import Login from '../views/login.vue';
import Users from '../views/users.vue';
import Register from '../views/register.vue';

const routes: RouteRecordRaw[] = [
  {
    path: '/login',
    name: 'login',
    component: Login,
  },
  {
    path: '/register',
    name: 'register',
    component: Register,
  },
  {
    path: '/user',
    name: 'user',
    component: Users,
  },
  {
    path: '/',
    redirect: { name: 'login' },
  }

];

const router = createRouter({
  history: createWebHashHistory(process.env.BASE_URL),
  routes,
});

export default router;
